/**
 * DbDaoAutoConfiguration.java
 * com.sftz.demo.config
 * Copyright (c) 2018, 北京科技有限公司版权所有.
*/

package com.sftz.sso.framework.config;

import org.nutz.dao.Dao;
import org.nutz.dao.impl.NutDao;
import org.nutz.plugin.spring.boot.NutzDaoAutoConfiguration;
import org.nutz.plugin.spring.boot.SqlManagerAutoConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.uxuexi.core.db.dao.impl.DbDao;

/**
 * 配置DbDao
 * <p>
 *
 * @author   朱晓川
 * @Date	 2018年9月27日 	 
 */
@Configuration
@ConditionalOnClass({ DbDao.class })
@AutoConfigureAfter({ DataSourceAutoConfiguration.class, SqlManagerAutoConfiguration.class,
		NutzDaoAutoConfiguration.class })
public class DbDaoAutoConfiguration {

	@Autowired
	private Dao dao;

	@Bean
	public DbDao dbDao() {
		return new DbDao((NutDao) dao);
	}
}
